<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%--
  Created by IntelliJ IDEA.
  User: Administrator
  Date: 2020/6/14
  Time: 1:49
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>菜单管理</title>
    <link rel="stylesheet" type="text/css" href="../../static/css/commonC3.css"/>
</head>
<body>


<table width="100%" border="1" style="text-align: center">

    <caption> <h1> 所有菜单选项列表 </h1> </caption>

    <tr>
        <th> 菜单层级 </th>
        <th> 菜单编号 </th>
        <th> 菜单名称 </th>
        <th> 菜单地址 </th>
        <th> 父级菜单编号 </th>
        <th> 菜单描述 </th>
        <th> 编辑操作 </th>
    </tr>
    <c:forEach items="${requestScope.menuPage.currentList}" var="menuItem">
        <tr>
            <c:choose>
               <c:when test="${menuItem.m_parent_id == 0}">
                   <td> 主菜单选项 </td>
               </c:when>

                <c:when test="${menuItem.m_parent_id > 0}">
                    <td> 子菜单选项 </td>
                </c:when>

                <c:otherwise>
                    <td> 空置 </td>
                </c:otherwise>
            </c:choose>

            <td> ${menuItem.m_id} </td>
            <td> ${menuItem.m_name} </td>
            <td> ${menuItem.m_url} </td>
            <td> ${menuItem.m_parent_id} </td>
            <td> ${menuItem.m_description} </td>
            <td>
                <a href=""> 修改此菜单选项 </a> |
                <a href=""> 删除此菜单选项 </a>
            </td>
        </tr>
    </c:forEach>

    <tr>
        <td colspan="7">

            <a href="?act=menuList"> 首页 </a> |
            <a href="?act=menuList&page=${requestScope.menuPage.pageIndex - 1}"> 上一页 </a> |
            第【${requestScope.menuPage.pageIndex}】页
            <a href="?act=menuList&page=${requestScope.menuPage.pageIndex + 1}"> 下一页 </a> |
            <a href="?act=menuList&page=${requestScope.menuPage.totalPages}"> 末页 </a> |
            一共【${requestScope.menuPage.totals}】记录，总共【${requestScope.menuPage.totalPages}】页
        </td>
    </tr>
</table>

</body>
</html>
